import { createRouter as _createRouter, createMemoryHistory, createWebHistory } from 'vue-router'
import Home from './views/Home.vue'
import About from '@/views/About.vue'

const routes = [
  {
    path: '/',
    component: Home,
    meta: {
      title: '首页',
      description: '这是首页描述'
    }
  },
  { path: '/about', component: About }
]

export function createRouter() {
  return _createRouter({
    history: import.meta.env.SSR 
      ? createMemoryHistory() 
      : createWebHistory(),
    routes
  })
}